﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyWebServer
{
    internal class jianCe
    {
        public static Hupaileixing JianCeHuPaiLeiXing(Desk desk,int chupaishuzi,bool isganghouchupai,bool isQiangGang)
        {
            List<int> listpai=new List<int>(desk.shoupai);
            listpai.Add(chupaishuzi);
            listpai.Sort();
            bool ismanzuhu = JianceIsHu(listpai);
            bool ismenqing = false;
            bool isxiaoqidui = false;
            if (listpai.Count >= 13)
            {
                ismenqing = true;
            } 
            if (listpai.Count == 14)
            {
                if (listpai[0] == listpai[1] && listpai[2] == listpai[3] && listpai[4] == listpai[5] && listpai[6] == listpai[7] && listpai[8] == listpai[9] && listpai[10] == listpai[11] && listpai[12] == listpai[13])
                {
                    ismanzuhu = true;
                    isxiaoqidui = true;
                }
            }
            if (ismanzuhu == false)
            {
                return Hupaileixing.buhu;
            }
            if (desk.cpg.Count > 0)
            {
                foreach (var item in desk.cpg)
                {
                    listpai.Add(item.cpglist[0]);
                    listpai.Add(item.cpglist[1]);
                    listpai.Add(item.cpglist[2]);
                }
            }
            listpai.Sort();
            bool ishunyise = false;
            List<int> fengList = new List<int>();
            List<int> tiaoList = new List<int>();
            List<int> bingList = new List<int>();
            List<int> wanList = new List<int>();
            for (int i = 0; i < listpai.Count; i++)
            {
                PaiXing paixing = GetPaixing(listpai[i]);
                if (paixing.Equals(PaiXing.feng))
                {
                    fengList.Add(listpai[i]);
                }
                if (paixing.Equals(PaiXing.tiao))
                {
                    tiaoList.Add(listpai[i]);
                }
                if (paixing.Equals(PaiXing.bing))
                {
                    bingList.Add(listpai[i]);
                }
                if (paixing.Equals(PaiXing.wan))
                {
                    wanList.Add(listpai[i]);
                }
            } //获取手牌中的牌看看都是什么类型的
            if ((fengList.Count > 0 && tiaoList.Count > 0 && bingList.Count == 0 && wanList.Count == 0)
                || (fengList.Count > 0 && tiaoList.Count == 0 && bingList.Count > 0 && wanList.Count == 0)
                || (fengList.Count > 0 && tiaoList.Count == 0 && bingList.Count == 0 && wanList.Count > 0))
            {
                ishunyise = true;
            }

            bool isqingyise = false;
            if ((fengList.Count > 0 && tiaoList.Count == 0 && bingList.Count == 0 && wanList.Count == 0)
                || (fengList.Count == 0 && tiaoList.Count > 0 && bingList.Count == 0 && wanList.Count == 0)
                || (fengList.Count == 0 && tiaoList.Count == 0 && bingList.Count > 0 && wanList.Count == 0)
                || (fengList.Count == 0 && tiaoList.Count == 0 && bingList.Count == 0 && wanList.Count > 0))
            {
                isqingyise = true;
            }
            bool isdaduizi = PanDuanDaDuiZi(listpai);
            bool isdasanyuan = false;

            if (fengList.Count >= 8)
            {
                int zfbshu = 0, hzshu = 0, fcshu = 0, bbshu = 0;
                for (int i = 0; i < fengList.Count; i++)
                {
                    int pxps = fengList[i];

                    if (pxps.Equals(PaiXingPaiShu.hz) || pxps.Equals(PaiXingPaiShu.fc) || pxps.Equals(PaiXingPaiShu.bb))
                    {
                        zfbshu++;
                    }
                    if (pxps.Equals(PaiXingPaiShu.hz))
                    {
                        hzshu++;
                    }
                    if (pxps.Equals(PaiXingPaiShu.fc))
                    {
                        fcshu++;
                    }
                    if (pxps.Equals(PaiXingPaiShu.bb))
                    {
                        bbshu++;
                    }
                }
                if (zfbshu >= 8 && hzshu > 0 && fcshu > 0 && bbshu > 0)
                {
                    isdasanyuan = true;
                }
            } //检测大三元
            bool isShuanggang = false;//检测双杠
            if (ismanzuhu)
            {
                if (isganghouchupai)
                {
                    if (isxiaoqidui)
                    {
                        if (ishunyise)
                        {
                            return Hupaileixing.gsp_hunyise_xiaoqidui;
                        }
                        if (isqingyise)
                        {
                            return Hupaileixing.gsp_qingyise_xiaoqidui;
                        }
                        return Hupaileixing.gsp_xiaoqidui;
                    }
                    else if (ishunyise)
                    {
                        if (isdaduizi)
                        {
                            return Hupaileixing.gsp_hunyise_daduizi;
                        }
                        if (isdasanyuan)
                        {
                            return Hupaileixing.gsp_hunyise_dasanyuan;
                        }
                        return Hupaileixing.gsp_hunyise;
                    }
                    else if (isqingyise)
                    {
                        if (isdaduizi)
                        {
                            return Hupaileixing.gsp_qingyise_daduizi;
                        }
                        if (isdasanyuan)
                        {
                            return Hupaileixing.gsp_qingyise_dasanyuan;
                        }
                        return Hupaileixing.gsp_qingyise;
                    }
                    if (isdasanyuan)
                    {
                        if (isdaduizi)
                        {
                            return Hupaileixing.gsp_daduizi_dasanyuan;
                        }
                        return Hupaileixing.gsp_dasanyuan;
                    }
                    if (isdaduizi)
                    {
                        return Hupaileixing.gsp_daduizi;
                    }
                    return Hupaileixing.gsp_pinhu;
                }
                else if (isQiangGang)
                {
                    if (isxiaoqidui)
                    {
                        if (ishunyise)
                        {
                            return Hupaileixing.qg_hunyise_xiaoqidui;
                        }
                        if (isqingyise)
                        {
                            return Hupaileixing.qg_qingyise_xiaoqidui;
                        }
                        return Hupaileixing.qg_xiaoqidui;
                    }
                    else if (ishunyise)
                    {
                        if (isdaduizi)
                        {
                            return Hupaileixing.qg_hunyise_daduizi;
                        }
                        if (isdasanyuan)
                        {
                            return Hupaileixing.qg_hunyise_dasanyuan;
                        }
                        return Hupaileixing.qg_hunyise;
                    }
                    else if (isqingyise)
                    {
                        if (isdaduizi)
                        {
                            return Hupaileixing.qg_qingyise_daduizi;
                        }
                        if (isdasanyuan)
                        {
                            return Hupaileixing.qg_qingyise_dasanyuan;
                        }
                        return Hupaileixing.qg_qingyise;
                    }
                    if (isdasanyuan)
                    {
                        if (isdaduizi)
                        {
                            return Hupaileixing.qg_daduizi_dasanyuan;
                        }
                        return Hupaileixing.qg_dasanyuan;
                    }
                    if (isdaduizi)
                    {
                        return Hupaileixing.qg_daduizi;
                    }
                    return Hupaileixing.qg_pinhu;
                }
                else
                {
                    if (isxiaoqidui)
                    {
                        if (ishunyise)
                        {
                            return Hupaileixing.hunyise_xiaoqidui;
                        }
                        if (isqingyise)
                        {
                            return Hupaileixing.qingyise_xiaoqidui;
                        }
                        return Hupaileixing.xiaoqidui;
                    }
                    if (ishunyise)
                    {
                        if (isdaduizi)
                        {
                            return Hupaileixing.hunyise_daduizi;
                        }
                        if (isdasanyuan)
                        {
                            return Hupaileixing.hunyise_dasanyuan;
                        }
                        return Hupaileixing.hunyise;
                    }
                    if (isqingyise)
                    {
                        if (isdaduizi)
                        {
                            return Hupaileixing.qingyise_daduizi;
                        }
                        if (isdasanyuan)
                        {
                            return Hupaileixing.qingyise_dasanyuan;
                        }
                        return Hupaileixing.qingyise;
                    }
                    if (isdasanyuan)
                    {
                        if (isdaduizi)
                        {
                            return Hupaileixing.daduizi_dasanyuan;
                        }
                        return Hupaileixing.dasanyuan;
                    }
                    if (isdaduizi)
                    {
                        return Hupaileixing.daduizi;
                    }
                    return Hupaileixing.pinhu;
                }
            }
            return Hupaileixing.buhu;
        }
        public static PengGangLeixing JiancePenggangLeixing(Desk desk, int chupaishuzi)
        {
            int sameshu = 0;
            PengGangLeixing pglx = PengGangLeixing.BupengBuGang;

            for (int i = 0; i < desk.shoupai.Count; i++)
            {
                if (desk.shoupai[i] == chupaishuzi)
                {
                    sameshu++;
                }
            }
            if (sameshu == 2)//peng
            {
                pglx = PengGangLeixing.Peng;

            }
            else if (sameshu == 3)//peng\gang
            {
                pglx = PengGangLeixing.Gang;
            }
            return pglx;
        }
        public static List<int> JianCeXiajiachi(Desk desk, int chupaishuzi)
        {
            List<int> templist = new List<int>();//用来存能吃的牌数字
            PaiXing px = GetPaixing(chupaishuzi);

            if (!px.Equals(PaiXing.feng))
            {
                List<int> list_hs = new List<int>(desk.shoupai);


                if ((list_hs.Contains(chupaishuzi + 1) && list_hs.Contains(chupaishuzi + 2))
                    || (list_hs.Contains(chupaishuzi + 1) && list_hs.Contains(chupaishuzi - 1))
                    || (list_hs.Contains(chupaishuzi - 1) && list_hs.Contains(chupaishuzi - 2)))
                {
                    if (list_hs.Contains(chupaishuzi + 1) && list_hs.Contains(chupaishuzi + 2))
                    {
                        templist.Add(chupaishuzi);
                        templist.Add(chupaishuzi + 1);
                        templist.Add(chupaishuzi + 2);
                    }

                    if (list_hs.Contains(chupaishuzi + 1) && list_hs.Contains(chupaishuzi - 1))
                    {
                        templist.Add(chupaishuzi - 1);
                        templist.Add(chupaishuzi);
                        templist.Add(chupaishuzi + 1);
                    }

                    if (list_hs.Contains(chupaishuzi - 1) && list_hs.Contains(chupaishuzi - 2))
                    {
                        templist.Add((chupaishuzi - 2));
                        templist.Add((chupaishuzi - 1));
                        templist.Add(chupaishuzi);
                    }
                }

            }
            return templist;
        }
        public static PaiXing GetPaixing(int Shuzi)
        {
            if (Shuzi >= 1 && Shuzi <= 9)
            {
                return PaiXing.tiao;
            }
            else if (Shuzi >= 21 && Shuzi <= 29)
            {
                return PaiXing.bing;
            }
            else if (Shuzi >= 41 && Shuzi <= 49)
            {
                return PaiXing.wan;
            }
            return PaiXing.feng;
        }
        public static bool JianceIsHu(List<int> list)
        {
            list.Sort();
            int count = 1;
            for (int i = 0; i < list.Count; i++)
            {
                List<int> newlist = new List<int>(list);
                newlist = FindJiang(newlist, count);
                count++;
                if (newlist != null)
                {
                    newlist=RemoveKeZiAndShunZi(newlist);
                    if (newlist.Count == 0)
                    {
                        return true;
                    }

                }
            }
            return false;
        }
        public static List<int> FindJiang(List<int> list,int i)
        {
            if (i >= list.Count)
            {
                return null;
            }
            if (list[i - 1] == list[i])
            {
                list.Remove(list[i]);
                list.Remove(list[i - 1]);
                return list;
            }
            else return null;
        }
        public static List<int> RemoveKeZiAndShunZi(List<int> list)
        {
            if (list.Count >= 3)
            {
                for (int j = 0; j < 5; j++)
                {
                    for (int i = 0; i < list.Count; i++)
                    {
                        if (i >= list.Count - 2)
                        {
                            break;
                        }
                        if (list[i] == list[i + 1] && list[i + 1] == list[i + 2])
                        {
                            list.Remove(list[i]);
                            list.Remove(list[i]);
                            list.Remove(list[i]);
                            break;
                        }
                        else if (list.Contains(list[i] + 1) && list.Contains(list[i] + 2))
                        {
                            list.Remove(list[i] + 2);
                            list.Remove(list[i] + 1);
                            list.Remove(list[i]);
                            break;
                        }
                    }
                }
            }
            return list;
        }
        public static bool PanDuanDaDuiZi(List<int> list_para)
        {
            List<int> list = new List<int>(list_para);
            list.Sort();
            int num = list.Count;
            for (int i = 0; i < num; i++)
            {
                for (int j = 0; j < list.Count; j++)
                {
                    if (j >= list.Count - 2)
                    {
                        break;
                    }
                    if (list[j] == list[j + 1] && list[j + 1] == list[j + 2])
                    {
                        list.RemoveAt(j);
                        list.RemoveAt(j);
                        list.RemoveAt(j);
                        break;
                    }
                }
            }

            if (list.Count == 2)
            {
                if (list[0] == list[1])
                {
                    return true;
                }
            }
            return false;
        }
        public static ZiMoLeixing JianceZimoLeixing(List<int> listshoupai, List<CPGProperties> listcpg, int mopaishuzi)
        {
            //把所有的牌添加进一个数组中
            List<int> listpai = new List<int>(listshoupai);
            listpai.Add(mopaishuzi);

            listpai.Sort();


            bool ismanzuhu = JianceIsHu(listpai);


            //吃碰杠里的牌这时能才添加进去
            if (listcpg.Count > 0)
            {
                foreach (var item in listcpg)
                {
                    listpai.Add(item.cpglist[0]);
                    listpai.Add(item.cpglist[1]);
                    listpai.Add(item.cpglist[2]);
                }

            }
            listpai.Sort();

            bool isxiaoqidui = false;
            if (listpai[0] == listpai[1] && listpai[2] == listpai[3] && listpai[4] == listpai[5] && listpai[6] == listpai[7]
                && listpai[8] == listpai[9] && listpai[10] == listpai[11] && listpai[12] == listpai[13])
            {
                isxiaoqidui = true;
            }

            bool ismenqing = false;
            if (listshoupai.Count >= 13)
            {
                ismenqing = true;
            }

            bool ishunyise = false;
            List<int> fengList = new List<int>();
            List<int> tiaoList = new List<int>();
            List<int> bingList = new List<int>();
            List<int> wanList = new List<int>();

            for (int i = 0; i < listpai.Count; i++)
            {
                PaiXing paixing = GetPaixing(listpai[i]);
                if (paixing.Equals(PaiXing.feng))
                {
                    fengList.Add(listpai[i]);
                }
                else if (paixing.Equals(PaiXing.tiao))
                {
                    tiaoList.Add(listpai[i]);
                }
                else if (paixing.Equals(PaiXing.bing))
                {
                    bingList.Add(listpai[i]);
                }
                else if (paixing.Equals(PaiXing.wan))
                {
                    wanList.Add(listpai[i]);
                }
            }

            if ((fengList.Count > 0 && tiaoList.Count > 0 && bingList.Count == 0 && wanList.Count == 0)
                || (fengList.Count > 0 && tiaoList.Count == 0 && bingList.Count > 0 && wanList.Count == 0)
                || (fengList.Count > 0 && tiaoList.Count == 0 && bingList.Count == 0 && wanList.Count > 0))
            {
                ishunyise = true;
            }

            bool isqingyise = false;
            if ((fengList.Count > 0 && tiaoList.Count == 0 && bingList.Count == 0 && wanList.Count == 0)
                || (fengList.Count == 0 && tiaoList.Count > 0 && bingList.Count == 0 && wanList.Count == 0)
                || (fengList.Count == 0 && tiaoList.Count == 0 && bingList.Count > 0 && wanList.Count == 0)
                || (fengList.Count == 0 && tiaoList.Count == 0 && bingList.Count == 0 && wanList.Count > 0))
            {
                isqingyise = true;
            }
            bool isdaduizi = PanDuanDaDuiZi(listpai);

            bool isdasanyuan = false;

            if (fengList.Count >= 8)
            {
                int zfbshu = 0, hzshu = 0, fcshu = 0, bbshu = 0;
                for (int i = 0; i < fengList.Count; i++)
                {
                    int pxps = fengList[i];

                    if (pxps.Equals(PaiXingPaiShu.hz) || pxps.Equals(PaiXingPaiShu.fc) || pxps.Equals(PaiXingPaiShu.bb))
                    {
                        zfbshu++;
                    }
                    if (pxps.Equals(PaiXingPaiShu.hz))
                    {
                        hzshu++;
                    }
                    if (pxps.Equals(PaiXingPaiShu.fc))
                    {
                        fcshu++;
                    }
                    if (pxps.Equals(PaiXingPaiShu.bb))
                    {
                        bbshu++;
                    }
                }
                if (zfbshu >= 8 && hzshu > 0 && fcshu > 0 && bbshu > 0)
                {
                    isdasanyuan = true;
                }
            }

            //判断小七对
            if (ismenqing)
            {
                if (isxiaoqidui)
                {
                    if (ishunyise)
                    {
                        return ZiMoLeixing.hunyise_xiaoqidui;
                    }
                    if (isqingyise)
                    {
                        return ZiMoLeixing.qingyise_xiaoqidui;
                    }
                    return ZiMoLeixing.xiaoqidui;
                }

            }

            if (ismanzuhu)
            {
                if (ismenqing)
                {
                    if (ishunyise)
                    {
                        if (isdaduizi)
                        {
                            return ZiMoLeixing.mq_hunyise_daduizi;
                        }
                        if (isdasanyuan)
                        {
                            return ZiMoLeixing.mq_hunyise_dasanyuan;
                        }
                        return ZiMoLeixing.mq_hunyise;
                    }
                    if (isqingyise)
                    {
                        if (isdaduizi)
                        {
                            return ZiMoLeixing.mq_qingyise_daduizi;
                        }
                        if (isdasanyuan)
                        {
                            return ZiMoLeixing.mq_qingyise_dasanyuan;
                        }
                        return ZiMoLeixing.mq_qingyise;
                    }
                    if (isdasanyuan)
                    {
                        if (isdaduizi)
                        {
                            return ZiMoLeixing.mq_daduizi_dasanyuan;
                        }
                        return ZiMoLeixing.mq_dasanyuan;
                    }
                    if (isdaduizi)
                    {
                        return ZiMoLeixing.mq_daduizi;
                    }
                    return ZiMoLeixing.mq_zimo;
                }
                else
                {

                    if (ishunyise)
                    {
                        if (isdaduizi)
                        {
                            return ZiMoLeixing.hunyise_daduizi;
                        }
                        if (isdasanyuan)
                        {
                            return ZiMoLeixing.hunyise_dasanyuan;
                        }
                        return ZiMoLeixing.hunyise;
                    }
                    if (isqingyise)
                    {
                        if (isdaduizi)
                        {
                            return ZiMoLeixing.qingyise_daduizi;
                        }
                        if (isdasanyuan)
                        {
                            return ZiMoLeixing.qingyise_dasanyuan;
                        }
                        return ZiMoLeixing.qingyise;
                    }
                    if (isdasanyuan)
                    {
                        if (isdaduizi)
                        {
                            return ZiMoLeixing.daduizi_dasanyuan;
                        }
                        return ZiMoLeixing.dasanyuan;
                    }
                    if (isdaduizi)
                    {
                        return ZiMoLeixing.daduizi;
                    }
                    return ZiMoLeixing.zimo;
                }

            }

            return ZiMoLeixing.buzimo;
        }
        public static ShangHuaLeiXing JianceShanghuaLeixing(List<int> listshoupai, List<CPGProperties> listcpg, int mopaishuzi)
        {
            //把所有的牌添加进一个数组中
            List<int> listpai = new List<int>(listshoupai);
            listpai.Add(mopaishuzi);

            listpai.Sort();

            bool ismanzuhu = JianceIsHu(listpai);

            bool ismenqing = false;//门前清
            if (listshoupai.Count >= 13)
            {
                ismenqing = true;
            }

            //吃碰杠里的牌这时能才添加进去
            if (listcpg.Count > 0)
            {
                foreach (var item in listcpg)
                {
                    listpai.Add(item.cpglist[0]);
                    listpai.Add(item.cpglist[1]);
                    listpai.Add(item.cpglist[2]);
                }
            }

            bool ishunyise = false;
            List<int> fengList = new List<int>();
            List<int> tiaoList = new List<int>();
            List<int> bingList = new List<int>();
            List<int> wanList = new List<int>();

            for (int i = 0; i < listpai.Count; i++)
            {
                PaiXing paixing = GetPaixing(listpai[i]);
                if (paixing.Equals(PaiXing.feng))
                {
                    fengList.Add(listpai[i]);
                }
                if (paixing.Equals(PaiXing.tiao))
                {
                    tiaoList.Add(listpai[i]);
                }
                if (paixing.Equals(PaiXing.bing))
                {
                    bingList.Add(listpai[i]);
                }
                if (paixing.Equals(PaiXing.wan))
                {
                    wanList.Add(listpai[i]);
                }
            }

            if ((fengList.Count > 0 && tiaoList.Count > 0 && bingList.Count == 0 && wanList.Count == 0)
                || (fengList.Count > 0 && tiaoList.Count == 0 && bingList.Count > 0 && wanList.Count == 0)
                || (fengList.Count > 0 && tiaoList.Count == 0 && bingList.Count == 0 && wanList.Count > 0))
            {
                ishunyise = true;
            }

            bool isqingyise = false;
            if ((fengList.Count > 0 && tiaoList.Count == 0 && bingList.Count == 0 && wanList.Count == 0)
                || (fengList.Count == 0 && tiaoList.Count > 0 && bingList.Count == 0 && wanList.Count == 0)
                || (fengList.Count == 0 && tiaoList.Count == 0 && bingList.Count > 0 && wanList.Count == 0)
                || (fengList.Count == 0 && tiaoList.Count == 0 && bingList.Count == 0 && wanList.Count > 0))
            {
                isqingyise = true;
            }
            bool isdaduizi = PanDuanDaDuiZi(listpai);

            bool isdasanyuan = false;

            if (fengList.Count >= 8)
            {
                int zfbshu = 0, hzshu = 0, fcshu = 0, bbshu = 0;
                for (int i = 0; i < fengList.Count; i++)
                {
                    int pxps = fengList[i];

                    if (pxps.Equals(PaiXingPaiShu.hz) || pxps.Equals(PaiXingPaiShu.fc) || pxps.Equals(PaiXingPaiShu.bb))
                    {
                        zfbshu++;
                    }
                    if (pxps.Equals(PaiXingPaiShu.hz))
                    {
                        hzshu++;
                    }
                    if (pxps.Equals(PaiXingPaiShu.fc))
                    {
                        fcshu++;
                    }
                    if (pxps.Equals(PaiXingPaiShu.bb))
                    {
                        bbshu++;
                    }
                }
                if (zfbshu >= 8 && hzshu > 0 && fcshu > 0 && bbshu > 0)
                {
                    isdasanyuan = true;
                }
            }

            if (ismanzuhu)
            {
                if (ismenqing)
                {

                    if (ishunyise)
                    {
                        if (isdaduizi)
                        {
                            return ShangHuaLeiXing.mq_hunyise_dadui_hua;
                        }
                        if (isdasanyuan)
                        {
                            return ShangHuaLeiXing.mq_hunyise_dasanyuan_hua;
                        }
                        return ShangHuaLeiXing.mq_hunyise_hua;
                    }
                    if (isqingyise)
                    {
                        if (isdaduizi)
                        {
                            return ShangHuaLeiXing.mq_qingyise_dadui_hua;
                        }
                        if (isdasanyuan)
                        {
                            return ShangHuaLeiXing.mq_qingyise_dasanyuan_hua;
                        }
                        return ShangHuaLeiXing.mq_qingyise_hua;
                    }
                    if (isdasanyuan)
                    {
                        if (isdaduizi)
                        {
                            return ShangHuaLeiXing.mq_dadui_dasanyuan_hua;
                        }
                        return ShangHuaLeiXing.mq_dasanyuan_hua;
                    }
                    if (isdaduizi)
                    {
                        return ShangHuaLeiXing.mq_dadui_hua;
                    }
                    return ShangHuaLeiXing.mq_gangshanghua;
                }
                else
                {
                    if (ishunyise)
                    {
                        if (isdaduizi)
                        {
                            return ShangHuaLeiXing.hunyise_dadui_hua;
                        }
                        if (isdasanyuan)
                        {
                            return ShangHuaLeiXing.hunyise_dasanyuan_hua;
                        }
                        return ShangHuaLeiXing.hunyise_hua;
                    }
                    if (isqingyise)
                    {
                        if (isdaduizi)
                        {
                            return ShangHuaLeiXing.qingyise_dadui_hua;
                        }
                        if (isdasanyuan)
                        {
                            return ShangHuaLeiXing.qingyise_dasanyuan_hua;
                        }
                        return ShangHuaLeiXing.qingyise_hua;
                    }
                    if (isdasanyuan)
                    {
                        if (isdaduizi)
                        {
                            return ShangHuaLeiXing.dadui_dasanyuan_hua;
                        }
                        return ShangHuaLeiXing.dasanyuan_hua;
                    }
                    if (isdaduizi)
                    {
                        return ShangHuaLeiXing.dadui_hua;
                    }
                    return ShangHuaLeiXing.gangshanghua;
                }

            }

            return ShangHuaLeiXing.bushanghua;
        }
    }
    
}
